//Component Object
const app = getApp();
const { apiInstance } = app

Component({
  properties: {
    data: {
      type: Object,
      value: {},
      observer: function (e) {
        console.log('data', e)
        if (e) {
          
          this.setData({
            form: e,
          })
        }
      }
    },
    isEdit: {
      type: Boolean,
      value: false,
      observer: function (e) {
        if (e) {
          this.setData({
            isEdit: e,
          })
        }
      }
    },
  },
  observers: {  
    'isEdit'(newVal, oldVal) {  
      // 当myProperty变化时执行的逻辑  
      console.log(`myProperty changed from ${oldVal} to ${newVal}`);  
    }  
  },
  data: {
    form: {},
    isEdit:false,
    comfirmPassCurrent:'',
    isOrNotList:[{
      id:1,
      name:'确认通过'
    },{
      id:2,
      name:'确认拒绝'
    }],
    
  },
  methods: {
    handleConfirmPassChange({detail}){
      this.setData({
        comfirmPassCurrent: detail.value,
         'form.comfirmPass': detail.value,
       });
    },
    bindValue(e){

      this.setData({
        [e.target.dataset.itemname]:e.detail.detail.value,
      });
    },
    
  },
  lifetimes: {
    created: async function (e) {
      console.log('queren组件created')
    },
    attached: function (e) {
      console.log('queren组件create1')
    },
    ready: async function (e) {
   


    },
    moved: function () {
      console.log('queren组件created3')
    },
    detached: function () {

    }
  }

});